<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt_rt" %>

<html>
<head>
    <title>登录页</title>
    <%--echart线图、柱状图、饼图等各种图型库 cdn--%>
    <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts/dist/echarts.min.js"></script>
    <%--jquery cdn--%>
    <script type="text/javascript" src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.1/jquery.js"></script>
</head>
<body>
欢迎${name} 登录     ${nickName} 绑定成功
<img src="${avatarUrl}">
<a href="https://gitee.com/oauth/authorize?client_id=d8cedc2a1b71137dfa8e8b9e077aa90376efc80fd98efda972b7829bc5e298dd&redirect_uri=http://localhost:8080/callbackCode.do&response_type=code
">gitee绑定</a>
<h1>-------------------------------------</h1>

<form action="/list.do">
    商品名称<input name="name" value="${query.name}"><br>
    品牌 <select name="brandId">
    <option value="">请选择</option>
    <c:forEach items="${brandList}" var="b">
        <option  ${query.brandId == b.id ?'selected':''} value="${b.id}">${b.name}</option>
    </c:forEach>
</select><br>
    分类 <select name="categoryId">
    <option value="">请选择</option>
    <c:forEach items="${categoryList}" var="c">
        <option   ${query.categoryId == c.id ?'selected':''}  value="${c.id}">${c.name}</option>
    </c:forEach>
</select><br>
    是否上架 <select name="flag">
    <option value="">请选择</option>
    <option ${query.flag == 1 ?'selected':''} value="1">是</option>
    <option ${query.flag == 0 ?'selected':''} value="0">否</option>

</select><br>
    <input type="submit" value="查询">
    <a href="/addPage.do">添加</a>


    <table>
        <tr>
            <td>编号</td>
            <td>名称</td>
            <td>品牌</td>
            <td>分类</td>
            <td>价格</td>
            <td>是否上架</td>
        </tr>
        <c:forEach items="${pageInfo.list}" var="l">
            <tr>
                <td>${l.num}</td>
                <td>${l.name}</td>
                <td>${l.brandName}</td>
                <td>${l.categoryName}</td>
                <td>${l.price}</td>
                <td>${l.flag == 1 ? '是':'否'}</td>
            </tr>
        </c:forEach>
    </table>
    <tr>
        <td><button name="pageNum" value="1"> 首页</button></td>
        <td><button name="pageNum" value="${pageInfo.prePage}"> 上页</button></td>
        <td><button name="pageNum" value="${pageInfo.nextPage}"> 下页</button></td>
        <td><button name="pageNum" value="${pageInfo.pages}"> 尾页</button></td>
    </tr>


</form>


</body>

</html>